package com.senken.controller;

import java.util.List;

import javax.swing.plaf.synth.SynthStyle;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.senken.entity.Reuturns;
import com.senken.service.IReuturnsService;
import com.senken.service.ITotalstateService;

@Controller
@RequestMapping("/return")
public class ReturnController {

	@Autowired
	private ITotalstateService totalstateService;
	@Autowired
	private IReuturnsService returnService;
	
	@RequestMapping("/counts")
	@ResponseBody
	public int counts(int state,int fid){
		return totalstateService.counts(fid, state);
	}
	
	@RequestMapping("/selectbystate")
	@ResponseBody
	public List<Reuturns> selectbystate(int state,int page){
		return returnService.selectReturnByState(state,page);
	}
	
	@RequestMapping("/selectOne")
	@ResponseBody
	public Reuturns selectOne(int hid){
		return returnService.selectreturn(hid);
	}
	
	@RequestMapping("/add")
	@ResponseBody
	public int add(String customer,String phone,int roleid){
		System.out.println(roleid);
		return returnService.add(customer, phone,roleid);
	}
}






